//
//  HLDiscountRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/8/16.
//

#import "HLDiscountRequest.h"

@implementation HLDiscountRequest

- (NSString *)requestUrl
{
    return @"/user/recommend/list";
}

- (YTKRequestMethod)requestMethod
{
    return YTKRequestMethodGET;
}

- (id)requestArgument
{
    return @{@"pageNum":@(1), @"labelCode": @"default", @"pageSize":HLListPageSize};
}

- (NSArray <HLHomeListModel *> *)discountList
{
    NSArray *lists = @[];
    
    NSDictionary *data = [self.result valueForKey:@"data"];
    if (![data isKindOfClass:[NSDictionary class]]){
        return lists;
    }
    
    NSArray *records = [data valueForKey:@"records"];
    if (records.count > 0) {
       lists = [HLHomeListModel mj_objectArrayWithKeyValuesArray:records];
    }
    
    return lists;
}

@end
